<?php
/**
 * FAQ模型
 * 
 * @version $Id: Faq.php 251 2012-03-19 08:27:18Z linsir123 $
 */
class modelFaq
{
	/**
	 * @var 分类列表
	 */
	public $types = array(
		0 => '返现相关',
		// 1 => '注册登录相关',
		2 => '提现相关',
	);
	
	/**
	 * 取得列表
	 */
	public function getList($key = 0)
	{
		if ( ! in_array($key, array_keys($this->types))) 
			return array();
			
		///
		$data = array();
		if (empty($key)) 
			$key = '';
			
		$file = APP_DIR."Config/xml/faq{$key}.xml";
		$o = simplexml_load_file($file);
		if (isset($o->item)) {
			foreach ($o->item as $v) 
				$data[] = array(
					'title' => (string) $v->title,
					'body' => (string) $v->body,
				);
		}
		
		return $data;
	}
}
